/*
 * FuzzyUtils.hpp
 *
 *  Created on: 07-01-2011
 *      Author: Piotr
 */

#pragma once

#include "geometry/Vector.hpp"

/**
 * Basic fuzzy logic sets functions and membership calculation
 */
class FuzzyUtils
{
	public:
		static const float MEMBER;
		static const float NOT_MEMBER;

	private:
		static float calculateLinearFuncion(float x, float xNotMember, float xMember);
		static float calculateLinearFuncion(float x, const Vector& p0, const Vector& p1);

	public:
		static float getMembershipValue(float value, float xMin, float xMax);
		static float
		getMembershipValue(float value, float xMin, float xPeek1, float xPeek2, float xMax);
		static float getMembershipValueRightInf(float value, float xMin, float xPeek);
		static float getMembershipValueLeftInf(float value, float xPeek, float xMax);

		static float fuzzyAnd(float value1, float value2);
		static float fuzzyOr(float value1, float value2);
		static float fuzzyNot(float value);
};
